package com.pratices.container;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ComponentScan("com.pratices.container")
public class StudentController {
    private StudentService primaryService;
    private StudentService secondaryService;


    //创建set方法
    @Autowired
    public void setPrimaryService(PostgraduateService primaryService) {
        this.primaryService = primaryService;
    }
    @Autowired
    public void setSecondaryService(UndergraduateService secondaryService) {
        this.secondaryService = secondaryService;
    }

    public void displayStudentInfo() {
        System.out.println("Primary: " + primaryService.getStudentInfo());
        System.out.println("Secondary: " + secondaryService.getStudentInfo());
    }
}
